import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import xiaoqi.springboot.start.ISchool;
import xiaoqi.springboot.start.Student;

@EnableAutoConfiguration
public class HomeworkBootstrap {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(HomeworkBootstrap.class)
                .web(WebApplicationType.NONE)  // 非 Web 应用
//                 .properties("formatter.enabled=true") // 配置默认属性, "=" 前后不能有空格
                .run(args);                    // 运行


        System.out.println(context.getBean(ISchool.class));
    }


    @Bean(name = "student100")
    public Student student() {
        return new Student();
    }
}
